let str1: string = "helloworld";
let str2: number = <any>str1;
// let str2: number = <number>str1;报错
let str3: number = str1 as any;
console.log(str2);

// 变量作用域
var global: string = "global";
class Def {
  lacl: number = 100;
  static sta: string = "staticStr";
  getNum(): number {
    var funLocal: number = 200;
    return funLocal;
  }
}
console.log("全局变量" + global);
console.log("静态变量" + Def.sta);
var obj: Def = new Def();
console.log("实例变量" + obj.lacl);
console.log("实例方法返回变量" + obj.getNum());
